.NET MAUI二维码扫描器
Use IronQR to scan QR codes in a .NET MAUI mobile application. Pick an image from the device library with FilePicker.Default.PickAsync, load it using AnyBitmap.FromFile, and decode it with QrReader.Read. Works on Android and iOS from a single shared codebase.
5-step guide for building a MAUI QR code scanner
- 使用 IronQr;
- 使用 IronSoftware.Drawing;
- var images = await FilePicker.Default.PickAsync(new PickOptions { FileTypes = FilePickerFileType.Images });
- var inputBmp = AnyBitmap.FromFile(images.FullPath.ToString());
- IEnumerable
results = reader.Read(imageInput);
代码解释
FilePicker.Default.PickAsync opens the native image picker on the current platform, filtered to image types. The selected file's full path is retrieved with images.FullPath.ToString() and passed to AnyBitmap.FromFile, which loads it into a bitmap regardless of format. A QrImageInput wraps that bitmap so IronQR can work with it, and QrReader.Read returns an IEnumerable<QrResult>. First().Value extracts the decoded string from the first result.
Explore the Full .NET MAUI QR Code Scanner Tutorial with IronQR.

